<template>
  <div class="main">
    <el-container class="main">
      <el-header ref="head-top">
        <head-top></head-top>
      </el-header>
      <el-container>
        <el-aside ref="left-tree">
          <left-tree></left-tree>
        </el-aside>
        <el-container>
          <el-main>
            <router-view/>
          </el-main>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import headTop from "../components/headTop";
import leftTree from "../components/leftTree";
export default {
  components: { headTop, leftTree },
  data() {
    return {
      headerTop: '0',
      headerShadow: '0 0 5px 0 rgba(0,0,0,.1)',
      leftTreeMaxWidth: '200px',
      leftTreeMinWidth: '60px',
      leftTreeBg: '#3C65D7'
    };
  },
  methods: {
    setStyle () {
      let top = this.$refs['head-top'].$el;
      let tree = this.$refs['left-tree'].$el;
      top.style.height = this.headerTop;
      top.style.boxShadow = this.headerShadow;
      tree.style.width = this.leftTreeMaxWidth;
      tree.style.background = this.leftTreeBg;
    }
  },
  mounted () {
    this.setStyle();
    console.log(this.$router);
  }
};
</script>
<style scoped>
.main{
  width: 100%;
  height: 100%;
}
</style>
